
<template>
  <div>
      <div
        v-if="!menu"
        class="avue-sidebar--tip">没有发现工位</div>
      <el-menu
        v-if="menu"
        :show-timeout="200"
        unique-opened
        mode="vertical">
        <sidebar-item
          :menu="menuTree"
          :props="menu.props"
          first />
      </el-menu>
  </div>
</template>

<script>
import sidebarItem from './craft-menu-sidebar'
import { craftMenuTree,delObj} from '@/api/pfoc/craft'
export default {
  name: 'craftMenu',
  components: { sidebarItem},
  computed: {

  },
  data() {
    return {
      // 配置工位菜单的属性
      menu: {
        props: {
          id: 'id',
          label: 'label',
          children: 'children'
        }
      },
      //获取工位树形数据
      menuTree: [],
      // 查询参数
      queryParams: {
        parentId: undefined,
        workPositionName: null,
      }
    }
  },
  created() {
    //获取工位树形数据
    this.getMenuTree()
  },
  methods: {
    getMenuTree() {
    this.loading = true
    craftMenuTree(this.queryParams).then(response => {
      this.menuTree = response.data.data
    })
  },
    }
}
</script>


